<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jsp/commons/taglibs.jsp" %>
<!DOCTYPE HTML>
<html ng-app>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <META HTTP-EQUIV="pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
    <title>${title}</title>
    <%@ include file="/WEB-INF/jsp/commons/meta.jsp" %>
    <link href="${ctx}/resources/new/style.css" type="text/css" rel="stylesheet"/>

</head>
<body>
<script>
    $(document).ready(function () {
        //聚焦第一个输入框
        $("#name").focus();
        //为inputForm注册validate函数
        $("#inputForm").validate({
            rules: {
                gorder: "required",
                name: "required",
                name: {
                    required: true,
                    remote: {
                        type: "POST",
                        url: "${ctx}/security/resourcesGroup/repeat",
                        data: {
                            account: function () {
                                return $.trim($("#name").val());
                            },
                            id: ${resourcesGroup.id == null ? 0:resourcesGroup.id}
                        }
                    }
                }
            },
            messages: {
                name: {
                    remote: "分组名称重复"
                }
            }

        });
    });
</script>
<!-- content -->
<form id="inputForm" class="well form-inline" action="${ctx}/security/resourcesGroup/save" method="post">
    <input type="hidden" name="id" value="${resourcesGroup.id}"/>
    <table class="table table-striped table-bordered table-condensed">
        <thead>
        <strong><i class="icon-flag"></i> 资源sss组表单</strong>
        </thead>
        <tr>
            <td class="span2">分组名称:</td>
            <td>
                <input id="name" name="name" type="text" value="${resourcesGroup.name}" size="30" maxlength="80"/>
            </td>
        </tr>
        <tr>
            <td>排序:</td>
            <td>
                <input id="gorder" name="gorder" type="text" value="${resourcesGroup.gorder}" size="30" maxlength="80"/>
            </td>
        </tr>
        <tr>
            <td>菜单:</td>
            <td>
                <label class="radio">
                    <input name="menu" type="radio" value="1"
                           <c:if test="${resourcesGroup.menu}">checked="checked"    </c:if> />
                    是
                </label>
                <label class="radio">
                    <input name="menu" type="radio" value="0"
                           <c:if test="${!resourcesGroup.menu}">checked="checked"    </c:if> />
                    否
                </label>
            </td>
        </tr>
        <tr>
            <td>备注:</td>
            <td>
                <textarea id="memo" name="memo" rows="4" class="span6">${resourcesGroup.memo}</textarea>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input class="btn" type="submit" value="提交"/>
                &nbsp;
                <input class="btn" type="button" value="返回" back="back" onclick="history.go(-1)"/>
            </td>
        </tr>
    </table>
</form>
</body>
</html>